package com.pyb.module.live.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.easefun.polyv.livescenes.feature.login.IPLVSceneLoginManager;
import com.easefun.polyv.livescenes.feature.login.PLVSceneLoginManager;
import com.pyb.java.commonutil.constant.RouterActivityPath;
import com.pyb.module.live.R;
import com.pyb.module.live.entity.VideoEntity;

import java.util.List;

public class PlayVideoRecycleAdapter extends BaseMultiItemQuickAdapter<VideoEntity, BaseViewHolder> {


    public PlayVideoRecycleAdapter(@Nullable List<VideoEntity> data) {
        super(data);
        addItemType(-1, R.layout.live_no_live_data_view);
        addItemType(1, R.layout.live_item_play_video);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, VideoEntity item) {
        switch (helper.getItemViewType()) {
            case -1:
                break;
            case 1:
                helper.getView(R.id.ivUserInfoHead)
                        .setOnClickListener(v -> ARouter.getInstance()
                                .build(RouterActivityPath.Live.PAGER_VIDEO_LIVE)
                                .navigation());
                break;
        }

    }
}
